furny.ga
Class PseudoSpace

java.lang.Object
  extended by furny.ga.PseudoSpace
All Implemented Interfaces:
IPhenotypeSpace

public class PseudoSpace
extends java.lang.Object
implements IPhenotypeSpace

This is a pseudo implementation of a phenotype space. It only calculates bounds virtually.

Since:
11.08.2012
Author:
Stephan Dreyer

Field Summary
private  math.geom2d.polygon.Rectangle2D bounds
           
 
Constructor Summary
PseudoSpace(float roomWidth, float roomLength)
          Creates a new pseudo phenotype space.
 
Method Summary
 boolean contains(math.geom2d.polygon.Polygon2D shape)
          Checks if a shape is inside the space and does not intersect the bounds.
 math.geom2d.polygon.Rectangle2D getOutterBounds()
          Gets the outter bounds of the space as rectangle.
 float minDistanceToWall(math.geom2d.polygon.Polygon2D shape, float angle)
          Calculates the minimum distance of a shape to a wall.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bounds

private final math.geom2d.polygon.Rectangle2D bounds
Constructor Detail

PseudoSpace

public PseudoSpace(float roomWidth,
                   float roomLength)
Creates a new pseudo phenotype space.

Parameters:
roomWidth - The width in meters.
roomLength - The length in meters.
Since:
11.08.2012
Method Detail

contains

public boolean contains(math.geom2d.polygon.Polygon2D shape)
Description copied from interface: IPhenotypeSpace
Checks if a shape is inside the space and does not intersect the bounds.

Specified by:
contains in interface IPhenotypeSpace
Parameters:
shape - Shape that has do be in the space.
Returns:
true if the shape is fully inside of the space.

getOutterBounds

public math.geom2d.polygon.Rectangle2D getOutterBounds()
Description copied from interface: IPhenotypeSpace
Gets the outter bounds of the space as rectangle.

Specified by:
getOutterBounds in interface IPhenotypeSpace
Returns:
Bounds rectangle.

minDistanceToWall

public float minDistanceToWall(math.geom2d.polygon.Polygon2D shape,
                               float angle)
Description copied from interface: IPhenotypeSpace
Calculates the minimum distance of a shape to a wall.

Specified by:
minDistanceToWall in interface IPhenotypeSpace
Parameters:
shape - The shape to check for distance to a wall.
angle - The angle of the shape.
Returns:
The minimum distance.